﻿@using Windvoice.Albums
@using Windvoice.Library.Mvc
@{
    ViewBag.Title = "Album";
    Layout = "~/Areas/Manage/Views/Shared/_Layout.cshtml";
}

@section headSection{
    <script type="text/javascript">
        $(function () {
            $('a[data-delete]').click(function () { $(this).handledelete('/manage/album/delete') });
        });
    </script>
}

<div class="pagetitle">
    <h2>相册管理</h2>
    <div class="pagefunctions">
        @Html.ActionLink("上传图片", "upload","photo")
        @Html.ActionLink("创建相册", "create")
    </div>    
</div>

<ul class="blog-list">
    @foreach (Album album in (Album[])ViewBag.AlbumList)
    {
        <li>
            <div class="title">
                <div class="titlevalue">@album.AlbumName</div>
                <div class="operate">
                    <a href="/manage/album/detail/@album.ID">详情</a>
                    <a href="/manage/album/edit/@album.ID">编辑</a>
                    <a href="javascript:;" data-delete="@album.ID">删除</a>
                </div>
            </div>
            <div class="content">
                @album.GetPhotoes().Length 张照片 
                @album.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") 
            </div>
        </li> 
    }
</ul>

@Html.Pager((int)ViewBag.RecordCount,PageSize:(int)ViewBag.PageSize)